package com.flyqiu.form.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

@EqualsAndHashCode(callSuper = true)
@Data
public class AvueSqlColumnModel extends SqlColumnModel {
    private String type;
    private String component;

    public void setType(String type) {
        if (type != null) {
            type = type.trim();
        }
        this.type = type;
    }

    public String getComponent() {
        if (StringUtils.isNotBlank(component)) {
            return component;
        }
        if (StringUtils.isNotBlank(type)) {
            return type;
        }
        return "input";
    }
}
